<?php
include dirname(dirname(__FILE__)) . '/conf.php';
include SERVER_ROOT . 'public/saetv2.ex.class.php';

$MENU_CONF = array(
	'time_conv'		=>	'时间转换',
	'ip'			=>	'IP查询',
	'md5'			=>	'MD5',
	//'serialize'		=>	'Serialize',
	//'json'			=>	'JSON',
	'url_encode'	=>	'URL编码',
	'base64'		=>	'Base64'
);
$DEFAULT_MENU = 'time_conv';

$action = get_str('action', $DEFAULT_MENU);
if (!array_key_exists($action, $MENU_CONF) || !file_exists($action . '.php')){
	exit('Sorry!');
}

$menu_str = '';
foreach ($MENU_CONF as $key=>$menu){
	if ($key == $action){
		$menu_str .= '<li style="background-color: #777777; font-weight:bold;"><a href="?action=' . $key . '">' . $menu . '</a></li>';
	}else{
		$menu_str .= '<li><a href="?action=' . $key . '">' . $menu . '</a></li>';
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HiTools</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/<?php echo $action?>.css" />
<script type="text/javascript" src="js/<?php echo $action?>.js"></script>
</head>
<body>
<div id="app-bg">
	<div id="navigation">
		<ul id="nav">
			<?php echo $menu_str ?>
		</ul>
	</div>

<?php require_once($action . '.php') ?>
